import http from "@/utils/request"
export default {
    // 获取广告位
    platFormSpaces:{
        url:"http://localhost:3000/platformspace",
        name:'广告位列表',
        get:async function(data){
            return await http.get(this.url,data)
        }
    },
    // 添加广告位
    addplatFormSpace:{
        url:"http://localhost:3000/platformspace",
        name:'添加广告位',
        post:async function(data){
            return await http.post(this.url,data)
        }
    },
    // 单个获取广告位
    platformSpace:{
        url:"http://localhost:3000/platformspace",
        name:'获取单个广告位',
        get:async function(id){
            return await http.get(this.url,id)
        }
    },
    // 修改广告位
    editplatformSpace:{
        url:"http://localhost:3000/platformspace",
        name:"修改广告位",
        put:async function(data){
            let id = data['id'];
            delete data['id']
            return await http.put(this.url+`/${id}`,data)
        }
    },
    // 删除广告位
    delplatformSpace:{
        url:"http://localhost:3000/platformspace",
        name:"删除广告位",
        delete:async function(id){
            return await http.delete(this.url+`/${id}`)
        }
    }
}